﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExpressionEngine
{
    /// <summary>
    /// 处理器接口：可扩展
    /// </summary>
    public class ExpressionHandler
    {
        #region 计算结果赋名称
        protected Variable ForName(Variable var)
        {
            if (var.ValueType == DataType.BOOL)
                return var;

            var.Name = var.Value.ToString();
            return var;
        }
        #endregion 

        #region 验证参数类型是否为数值
        protected bool bNumberical(Variable var)
        {
            if (var.ValueType == DataType.DOUBLE
                || var.ValueType == DataType.FLOAT
                || var.ValueType == DataType.INT)
                return true;

            return false;
        }
        #endregion
    }
}
